Imports System.Data
Imports System.Globalization

Public Class ACBuscarEntidad
#Region "Variables"
   Inherits System.Windows.Forms.UserControl

   Public Event CodigoButtonClick(ByVal sender As Object, ByVal e As System.EventArgs)
   Public Event DocumentoButtonClick(ByVal sender As Object, ByVal e As System.EventArgs)
   Public Event DescripcionButtonClick(ByVal sender As Object, ByVal e As System.EventArgs)

   Private m_codigo As String
   Private m_descripcion As String
   Private m_documento As String
   Private m_direcciones As DataTable
#End Region

#Region "Contructores"
   Public Sub New()
      MyBase.New()
      ' This call is required by the Windows Form Designer.
      InitializeComponent()
      ' Add any initialization after the InitializeComponent() call.
      Me.Size() = New System.Drawing.Size(580, 48)
   End Sub
#End Region

#Region " Propiedades "
   Public Property Codigo() As String
      Get
         Return m_codigo
      End Get
      Set(ByVal value As String)
         m_codigo = value
         NSCodigo.Text = m_codigo
      End Set
   End Property
   Public Property Descripcion() As String
      Get
         Return m_descripcion
      End Get
      Set(ByVal value As String)
         m_descripcion = value
         NSDescripcion.Text = m_descripcion
      End Set
   End Property
   Public Property Documento() As String
      Get
         Return m_documento
      End Get
      Set(ByVal value As String)
         m_documento = value
         NSDocumento.Text = m_documento
      End Set
   End Property
   Public Property Direcciones() As DataTable
      Get
         Return m_direcciones
      End Get
      Set(ByVal value As DataTable)
         m_direcciones = value

         NSDirecciones.DataSource = m_direcciones
         NSDirecciones.DisplayMember = "DIRE_Descripcion"
         NSDirecciones.ValueMember = "DIRE_Item"

      End Set
   End Property
   Public ReadOnly Property GetDireccion() As String
      Get
         Return NSDirecciones.SelectedValue.ToString()
      End Get
   End Property
#End Region

#Region " Eventos Botones "
   Private Sub txtCodigo_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NSCodigo.ACAyudaClick
      RaiseEvent CodigoButtonClick(sender, e)
   End Sub
   Private Sub txtDocumento_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NSDocumento.ACAyudaClick
      RaiseEvent DocumentoButtonClick(sender, e)
   End Sub
   Private Sub txtRazonSocial_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NSDescripcion.ACAyudaClick
      RaiseEvent DescripcionButtonClick(sender, e)
   End Sub
#End Region

End Class
